﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using System.Data;
using System.Data.SqlClient;
using REPORT.DAL;
namespace REPORT.GUI
{
    public partial class XtraRptHoaDon : DevExpress.XtraReports.UI.XtraReport
    {
        int STT = 0;
        public DataSet ds = new DataSet();
        DAL_HOADON dalhd = new DAL_HOADON();
        public XtraRptHoaDon()
        {
            InitializeComponent();
        }
        public void BindsListHD()
        {
            xrCellTenHang.DataBindings.Add("Text", DataSource, "ten_san_pham");
            xrCellDonViTinh.DataBindings.Add("Text", DataSource, "don_vi_tinh");
            xrCellSoLuong.DataBindings.Add("Text", DataSource, "so_luong");
            xrCellDonGia.DataBindings.Add("Text", DataSource, "don_gia");
            xrCellThanhTien.DataBindings.Add("Text", DataSource, "thanh_tien");
        }
        public DataSet LoadTheoMaHD(int mahd)
        {
            ds = dalhd.LoadTheoMaHD(mahd);
            return ds;
        }
        private void XtraRptHoaDon_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            STT++;
            xrCellSTT.Text = STT.ToString();
        }
    }
}
